<!DOCTYPE html>
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <!-- basic styles -->
        <link href="../../assets/js/plugin/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link rel="stylesheet" href="../../assets/css/font-awesome.min.css" />
        <link type="text/css" rel="stylesheet" href="../../assets/js/plugin/jquery-ui/css/jquery-ui.css" />
        <!--<link href="../../assets/js/plugin/datepicker/css/jquery-datepicker.css" rel="stylesheet" media="screen" />-->
        <!--<link href="../../assets/js/plugin/check/check.css" rel="stylesheet" media="screen" />-->
        <link rel="stylesheet" href="../../assets/css/ace.min.css" />
        <link rel="stylesheet" type="text/css" media="all" href="../../assets/js/date-time/daterangepicker-bs3.css"/>
        <style>
            .controls span.help-inline {
                font-size: 12px;
                color: #999
            }
            .modal-body{max-height: 200px;}
            .form-horizontal .row-fluid .left{
                float: left;
                width: 50%;
                margin: 0px;
                padding: 0px;
            }
            .header{padding-left:20px; margin-top: 20px;}
            .row-fluid{border-bottom: 1px solid #d5e3ef;margin-bottom: 10px}
        </style>

    </head>

    <body>
        <div class="main-container">
            <h4 style="padding-left:20px; margin-top: 20px;" class='header smaller lighter blue'>用户/应用策略信息下发添加</h4>
            <form class="form-horizontal">  
                <div class="control-group">
                    <label class="control-label" for="policy_desc">策略名称:</label>
                    <div class="controls">
                        <input class="policy_desc" type="text" name="1" id="policy_desc" placeholder="" required>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="Bind_Action">绑定动作类型</label>
                    <div class="controls" >
                        <select id="Bind_Action" class="Bind_Action">
                            <option value="1">增加</option>
                            <option value="2">删除</option>
                        </select>
                        <!--<span class="help-inline">用户/应用策略绑定关系</span>-->
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="UserType">用户类型</label>
                    <div class="controls">
                        <select class="UserType" id="UserType"> 
                            <option value="0">针对所有用户的全局策略</option>
                            <option value="1">针对帐号用户</option>
                            <option value="2">针对静态 IP 地址用户</option>
                            <option value="3">针对组用户</option>
                        </select>
                    </div>
                </div> 
                <div class="control-group">
                    <label class="control-label" for="UserName">用户帐号(组名)</label>
                    <div class="controls">
                        <input id="UserName" class="UserName" name="2" type="text" required/>
                    </div>
                </div>
                <div class="add">

                </div>

                <div class="control-group">
                    <div class="controls">
                        <button type="button" class="btn btn-sm btn-danger up">
                            <i class="icon-arrow-left"></i>
                            查看上一个版本
                        </button>
                        &nbsp; &nbsp; &nbsp;
                        <button type="button" class="btn btn-sm btn-danger next" disabled="">
                            <i class="icon-arrow-right"></i>
                            查看下一个版本
                        </button>
                        &nbsp; &nbsp; &nbsp;
                        <button type="button" class="btn btn-sm btn-danger" onclick="previous();">
                            <i class="icon-undo"></i>
                            返回
                        </button>
                    </div>
                </div>
            </form>
        </div>

        <script src="../../assets/js/jquery.js"></script>
        <script src="../../assets/js/plugin/bootstrap/js/bootstrap.min.js"></script>
        <script type='text/javascript' src="../../assets/js/plugin/jquery-ui/jquery-ui.js"></script>
        <!--<script src="../../assets/js/plugin/datepicker/js/jquery-datepicker.js"></script>-->
        <script src="../../assets/js/date-time/moment.js"></script>
        <script src="../../assets/js/date-time/daterangepicker.js"></script>
        <script src="../../assets/js/plugin/menu/menu.js"></script>
        <script src="../../assets/js/jquery.validate.js"></script>
        <script src="../../assets/js/jquery.validate-util.js"></script>
        <!--<script src="../../assets/js/logic/overlayer.js"></script>-->
        <script src="../../assets/js/Base64.js"></script>
        <script src="logic.js"></script>
        <script type="text/javascript">
                            var id = getQueryString("id");
                            var policyArray, policyAmount, actualQuantity;
                            $(function() {
                                getAllPolicy();
                                //初始化数据
                                actualQuantity = policyAmount - 1;
                                show_oldPolicy(policyArray, actualQuantity);
                                if (actualQuantity == 0) {
                                    $(".up").attr("disabled", "");
                                }
                                if (actualQuantity == (policyAmount - 1)) {
                                    $(".next").attr("disabled", "");
                                }
                                $(".up").click(function() {
                                    $(".add").html("");
                                    actualQuantity = actualQuantity - 1;
                                    show_oldPolicy(policyArray, actualQuantity);
                                    $(".next").removeAttr("disabled");
                                    if (actualQuantity == 0) {
                                        $(".up").attr("disabled", "");
                                    }
                                });
                                $(".next").click(function() {
                                    $(".add").html("");
                                    actualQuantity = actualQuantity + 1;
                                    show_oldPolicy(policyArray, actualQuantity);
                                    $(".up").removeAttr("disabled");
                                    if (actualQuantity == (policyAmount - 1)) {
                                        $(".next").attr("disabled", "");
                                    }
                                });
                            })
        </script>
    </body>
</html>
